using Microsoft.AspNetCore.Mvc;
using WidgetsDesign.API.Services;

namespace WidgetsDesign.API.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class DictController:ControllerBase
    {
        private readonly IDictRepository _dictRepository;
        public DictController(IDictRepository dictRepository)
        {
            _dictRepository = dictRepository;
        }
        [HttpGet]
        public async Task<IActionResult> GetDict([FromQuery] string key)
        {
            var result = await _dictRepository.GetDictAsync(key);
            return Ok(result);
        }
    }
}